/*
 * @Description:  js 创建对象的方式
 * @Author: zzj
 * @Date: 2021-09-07 10:53:31
 * @LastEditors: zzj
 * @LastEditTime: 2021-09-07 10:58:50
 */

//工厂模式
function Dog(name,age){
    var obj =  new Object();
    obj.name = name;
    obj.age = age;
    return obj;
}
var d1 = Dog("小白",2);
var d2 = Dog("小黑",1);
console.log(d1);
console.log(d2.name);